using System;
using System.Collections.Generic;
using System.Text;

namespace Spacedash.Logic
{
    /// <summary>
    /// List of states that a race can be in
    /// </summary>
    public enum RaceStateList
    {
        /// <summary>
        /// Loading state
        /// </summary>
        Loading,
        /// <summary>
        /// Starting race state
        /// </summary>
        Starting,
        /// <summary>
        /// Racing state
        /// </summary>
        Racing,
        /// <summary>
        /// Finishing race state
        /// </summary>
        Finishing,
        /// <summary>
        /// Race finished state
        /// </summary>
        Finished
    }
    /// <summary>
    /// RaceState is the base class for each of the states that a race can have: Loading, Starting, Racing...
    /// Each state will have its own logic and will be able to change the race state when they are finished.
    /// </summary>
    public abstract class RaceState
    {
        /// <summary>
        /// Race instance that has created this state
        /// </summary>
        protected Race race;
        /// <summary>
        /// Race instance that has created this state
        /// </summary>
        public Race Race { get { return race; } }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="race">Race that's creating this instance</param>
        public RaceState(Race race)
        {
            this.race = race;
        }

        /// <summary>
        /// Returns this state's identifier (so other classes can determine which state is the race on)
        /// </summary>
        public abstract RaceStateList State { get;}

        /// <summary>
        /// Updates the state's logic
        /// </summary>
        public abstract void Update();
    }
}
